#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QMainWindow>

class BuyCatalog;
class QPushButton;

namespace Ui {
    class MainWindow;
}

class MainWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    virtual ~MainWindow();
    void listLevels(const QString& aString);
    void updateLevels();

private slots:
    void playLevel();
    void catalogClosed();
    void mainWindowClose();
    void mainWindowResetPurchases();

private:
    bool isPurchased(int drmErrCode, QString& fileName);
    QString getProductId(const QString& path);

public:
    static QString getTicketDir();
    static QString getTicketUri(const QString& productID);
    static bool readTicket(const QString& productID);
    static void saveTicket(const QString& purchaseTicket,
                           QString& productID);

private:
    //data
    QPushButton* getButton(QString& fname);
    QStringList* gameLevels;
    BuyCatalog* catalog;
	
private:
    Ui::MainWindow *ui;
};

#endif // MAINWINDOW_H
